package com.orhon.smartcampus.modules.systemctl.mm;


import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import com.orhon.smartcampus.modules.base.mm.DictionaryMapper;
import com.orhon.smartcampus.modules.base.mm.GradeMapper;
import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.base.mm.SchoolMapper;
import com.orhon.smartcampus.modules.base.mm.SubjectMapper;
import com.orhon.smartcampus.modules.systemctl.entity.OrgDepartments;
import com.orhon.smartcampus.modules.systemctl.gqlModel.GQLDepartment;
import com.orhon.smartcampus.modules.user.mm.UserMapper;


@Mapper(uses = {
        DictionaryMapper.class,
        LangMapper.class,
        UserMapper.class,
        SubjectMapper.class,
        GradeMapper.class,
        SchoolMapper.class
        
})
public interface DepartmentMapper {

    DepartmentMapper MAPPER = Mappers.getMapper(DepartmentMapper.class);

    @Mapping(source = "id" , target = "id")
    @Mapping(source = "departmentName" , target = "department_name")
    @Mapping(source = "departmentOrder" , target = "department_order")
    @Mapping(source = "type" , target = "type")
    @Mapping(source = "groupType" , target = "group_type")
    @Mapping(source = "status" , target = "status")
    @Mapping(target = "school" , ignore = true)
    @Mapping(target = "parent" , ignore = true)
    @Mapping(target = "grade" , ignore = true)
    @Mapping(target = "subject" , ignore = true)
    @Mapping(target = "duties" , ignore = true)
    @Mapping(target = "users" , ignore = true)
    @Mapping(target = "childreen" , ignore = true)
    GQLDepartment toOrgDepartments(OrgDepartments entity);
    
    @InheritConfiguration(name = "toOrgDepartments")
    List<GQLDepartment> toOrgDepartmentsList(List<OrgDepartments> entities);

}
